package com.zy.smartdb.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @Description:
 * @Author: zara
 * @Version V3.0
 * @Date: 2022/9/29 2:29 下午
 */

@Data
@AllArgsConstructor
public class AjaxResult {
    private int code;
    private String msg;
    private Object data;

    public static AjaxResult success(Object data) {
        return new AjaxResult(200, "操作成功", data);
    }

    public static AjaxResult success() {
        return new AjaxResult(200, "操作成功", null);
    }

    public static AjaxResult error(String message) {
        return new AjaxResult(500, message, null);
    }
}
